package com.example.testapp

class CustomAlefHandler {
    private var handlerEnabled: Boolean = false
    private var messageQueue: MutableList<String> = mutableListOf()
    
    fun enableHandler() {
        handlerEnabled = true
    }
    
    fun disableHandler() {
        handlerEnabled = false
        messageQueue.clear()
    }
    
    fun handleMessage(message: String): Boolean {
        if (!handlerEnabled) {
            return false
        }
        
        messageQueue.add(message)
        processMessage(message)
        return true
    }
    
    private fun processMessage(message: String) {
        // Process the message
        println("Processing message: $message")
    }
    
    fun getQueueSize(): Int {
        return messageQueue.size
    }
    
    fun clearQueue() {
        messageQueue.clear()
    }
    
    fun isEnabled(): Boolean {
        return handlerEnabled
    }
}